package  
{
	/**
	 * ...
	 * @author Shen
	 */
	import flash.display.*;
	import flash.events.*;
	
	public class Bubble extends MovieClip
	{
		public var xSpeed:Number = 3;
		public var ySpeed:Number = 3000;
		
		public var Angle:Number;
		
		private var accelX:Number;
		private var accelY:Number;
		
		public function Bubble(_Angle:Number) 
		{
			Angle = _Angle;
			trace("BubbleAngle", Angle);
			
			accelX = Math.sin(Angle * Math.PI / 180) * 10;
			
			//accelX = 20;
			accelY = -Math.cos((Angle) * Math.PI / 180) * 10;;
		}
		
		public function frameH(e:Event) {
			
			//x -= xSpeed * Main.TIME_DIFF;
			//trace (x);
			//y -= ySpeed * Main.TIME_DIFF;
			//y = -(x*x)/+ 400;
			if (accelX > 0) {
				accelX -= 1;
				accelY -= 1;
			}
			
			x += accelX;
			y += accelY;
			
			
			if (y < -100) {
				if (this.parent != null) {
					this.parent.removeChild(this);
					//removeEventListener(Event.ENTER_FRAME, frameH);
				}
			}
		}
		
	}

}